﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace STX.Domain
{
    public  class BizSolution:BaseEntity
    {
        public string Title { get; set; }
        public string Info { get; set; }
        public string SolutionUrl { get; set; }
        public string Comment { get; set; }
        public string AddTime { get; set; }
        public SolutionStepEnum Step { get; set; }

        [Flags]
        public enum SolutionStepEnum
        {
            [Field(Name = "制作方案")]
            [SolutionStep(NextStep = 项目经理审核方案, PrevStep = 制作方案)]
            制作方案 = 1,

            [Field(Name = "项目经理审核方案")]
            [SolutionStep(NextStep = 项目总监审核方案, PrevStep = 制作方案)]
            项目经理审核方案 = 2,

            [Field(Name = "项目总监审核方案")]
            [SolutionStep(NextStep = 财务经理审核方案, PrevStep = 制作方案)]
            项目总监审核方案 = 4,

            [Field(Name = "财务经理审核方案")]
            [SolutionStep(NextStep = 财务总监审核方案, PrevStep = 制作方案)]
            财务经理审核方案 = 8,

            [Field(Name = "财务总监审核方案")]
            [SolutionStep(NextStep = 总经理审核方案, PrevStep = 制作方案)]
            财务总监审核方案 = 16,

            [Field(Name = "总经理审核方案")]
            [SolutionStep(NextStep = 总经理审核方案, PrevStep = 制作方案)]
            总经理审核方案 = 32,
        }

        
    }

    [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property)]
    public class SolutionStepAttribute : System.Attribute
    {

        public BizSolution.SolutionStepEnum NextStep { get; set; }
        public BizSolution.SolutionStepEnum PrevStep { get; set; }

    }
}
